package de.project.resistor;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.CheckedTextView;

public class CheckedColorTextView extends CheckedTextView {
	public CheckedColorTextView(Context context) {
		super(context);
}

public CheckedColorTextView(Context context, AttributeSet attrs) {
	super(context, attrs);
}

@Override
public void onDraw(Canvas canvas) {
	int color = Color.parseColor(getText().toString());
	Paint paint = new Paint();
	paint.setColor(color);
	setTextColor(color);

	canvas.drawRoundRect(new RectF(0, 0, getWidth(), getHeight()), 5, 5, paint);
	super.onDraw(canvas);
	}
}